#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int singleNumber(vector<int>& nums) {
	sort(nums.begin(), nums.end());
	if (nums[1] != nums[0])
	{
		return nums[0];
	}
	for (int i = 1; i < nums.size()-1; i++)
	{

		if (!(nums[i - 1] == nums[i] || nums[i + 1] == nums[i]))
		{
			return nums[i];
		}

	}
	if (nums[nums.size() - 1] != nums[nums.size() - 2])
	{
		return nums[nums.size() - 1];
	}

}
int main()
{
	int arr[] = { 1,1,1,2,2,2,5,7,7,7 };
	vector<int> v(arr, arr + sizeof(arr) / sizeof(arr[0]));
	//sort(v.begin(), v.end());*/
	//for (auto x : v)
	//{
	//	cout << x << " ";
	//}
	//cout << endl;
	int k=singleNumber(v);
 
}